package com.xjl.controller;

import com.xjl.domain.Student;
import com.xjl.domain.Student2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class TestController {
    @Autowired
    private Student2 stu;

    @Autowired
    private Student stu2;
    //@Value只能单个读取配置文件
    @Value("${student.lastName}")
    private String lastName;

    @RequestMapping("/test")
    public String test(){
        System.out.println(lastName);
        return "hi";
    }


}

